﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WW.NActiveRecord.Attriutes;

namespace WW.NActiveRecord.Tests.Models
{
    [Table(Name = "Suppliers")]
    public class Supplier : Base<Supplier>
    {
        private readonly MemberField<int> supplierID = new MemberField<int>();
        private readonly MemberField<string> companyName = new MemberField<string>();
        private readonly MemberField<string> contactName = new MemberField<string>();
        private readonly MemberField<string> contactTitle = new MemberField<string>();
        private readonly MemberField<string> address = new MemberField<string>();
        private readonly MemberField<string> city = new MemberField<string>();
        private readonly MemberField<string> region = new MemberField<string>();
        private readonly MemberField<string> postalCode = new MemberField<string>();
        private readonly MemberField<string> country = new MemberField<string>();
        private readonly MemberField<string> phone = new MemberField<string>();
        private readonly MemberField<string> fax = new MemberField<string>();
        private readonly MemberField<string> homePage = new MemberField<string>();

         
        private readonly MemberSet<Product> products = HasMany<Product>("SupplierID");


        public int SupplierID
        {
            get
            {
                return this.supplierID;
            }
            set
            {
                this.supplierID.Value = value;
            }
        }

        public string CompanyName
        {
            get
            {
                return this.companyName;
            }
            set
            {
                this.companyName.Value = value;
            }
        }
         public string ContactName
        {
            get
            {
                return this.contactName;
            }
            set
            {
                this.contactName.Value = value;
            }
        }
        public string ContactTitle
        {
            get
            {
                return this.contactTitle;
            }
            set
            {
                this.contactTitle.Value = value;
            }
        }
        public string Address
        {
            get
            {
                return this.address;
            }
            set
            {
                this.address.Value = value;
            }
        }
 
        public string City
        {
            get
            {
                return this.city;
            }
            set
            {this.city.Value = value;
            }
        }
        public string Region
        {
            get
            {
                return this.region;
            }
            set
            {
                this.region.Value = value;
            }
        }
 
        public string PostalCode
        {
            get
            {
                return this.postalCode;
            }
            set
            {
                this.postalCode.Value = value;
            }
        }
         public string Country
        {
            get
            {
                return this.country;
            }
            set
            {
                this.country.Value = value;
            }
        }
 
        public string Phone
        {
            get
            {
                return this.phone;
            }
            set
            {
                this.phone.Value = value;
            }
        }
         public string Fax
        {
            get
            {
                return this.fax;
            }
            set
            {
                this.fax.Value = value;
            }
        }
         public string HomePage
        {
            get
            {
                return this.homePage;
            }
            set
            {                
                this.homePage.Value = value;
             }
        }

 

        public EntitySet<Product> Products2
        {
            get { return products.Value; }
        }
    }

     
}
